from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import text

app = Flask(__name__)

# 声明数据库的配置
app.config['SQLALCHEMY_DATABASE_URL'] = 'mysql://......'
db = SQLAlchemy(app)


@app.route("/")
def test():
    sql = text("SELECT * FROM 'user'")
    result = db.engine.execute(sql)
    for row in result:
        app.logger.info(row)

    return "Test"